<?php
// 数据库连接配置
$servername = "localhost";
$username = "admin";
$password = "123456";
$dbname = "worklite_com";

function result()
{
    // 查询数据
    // 创建数据库连接
    $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);

    // 检查连接
    if ($conn->connect_error) {
        die("连接失败: " . $conn->connect_error);
    }else{

        $sql = "SELECT id, name, age, email FROM manager";
        $result = $conn->query($sql);
        return $result;
    }
    // $sql = "SELECT id, name, age, email FROM users";
    // $result = $conn->query($sql);
}
echo result();

?>